import type { ArticleData, ArticleResult } from '@/types/article'
import type { PublishArticleResponse } from '@/types/publish'
import { request } from '@/utils/request'

// 获取文章列表
export const getArticleListApI = (data: ArticleData) => {
  return request<ArticleResult>('/v1_0/mp/articles', 'GET', data)
}

// 获取文章详情
export const delArticleAPI = (id: string) => {
  return request(`/v1_0/mp/articles/${id}`, 'DELETE')
}

// 发表文章
export const publishArticleAPI = (params: PublishArticleResponse) => {
  return request<ArticleResult>('/v1_0/mp/articles', 'POST', params)
}
